package com.module.controller;

import com.module.framework.domain.Expire;
import com.module.framework.domain.ResponseResult;
import com.module.framework.dto.ExpireDTO;
import com.module.framework.service.ExpireService;
import com.module.framework.vo.PageVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/expire")
public class ExpireController {


    @Autowired
    private ExpireService expireService;

    @PostMapping("/list")
    public ResponseResult productList(@RequestBody ExpireDTO expireDTO) {
        PageVO pageVO = expireService.expireList(expireDTO);
        return ResponseResult.okResult(pageVO);
    }

    @GetMapping("/info")
    public ResponseResult getBookInfo(Integer id) {
        Expire expire = expireService.getExpireInfo(id);
        return ResponseResult.okResult(expire);
    }
}
